using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_BCodeRuleFieldMap : EntityTypeConfiguration<t_BCodeRuleField>
    {
        public t_BCodeRuleFieldMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FBCodeRuleId, t.FBCodeItemId });

            // Properties
            this.Property(t => t.FBCodeRuleId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FBCodeItemId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FPrecision)
                .HasMaxLength(80);

            // Table & Column Mappings
            this.ToTable("t_BCodeRuleField");
            this.Property(t => t.FBCodeRuleId).HasColumnName("FBCodeRuleId");
            this.Property(t => t.FStartPos).HasColumnName("FStartPos");
            this.Property(t => t.FEndPos).HasColumnName("FEndPos");
            this.Property(t => t.FBCodeItemId).HasColumnName("FBCodeItemId");
            this.Property(t => t.FPrecision).HasColumnName("FPrecision");
        }
    }
}
